package com.phyane.bbs.action;

import com.opensymphony.xwork2.ActionSupport;
import com.phyane.bbs.param.BbsUserParam;
import com.phyane.bbs.service.BbsLoginService;

public class BbsLoginAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1539471002960362633L;
	private BbsUserParam user;
	
	public String execute(){
		BbsLoginService service = new BbsLoginService();
		System.out.println(user.getName());
		System.out.println(user.getPasswd());
		if(service.login(user)){
			return SUCCESS;
		}else{
			return LOGIN;
		}
	}
	
	public String addUser(){
//		BbsLoginService service = new BbsLoginService();
		System.out.println("In register procession");
		System.out.println(user.getPasswd());
//		if(service.login(user)){
//			
//		}else{
//			return LOGIN;
//		}
		return SUCCESS;
	}
	public BbsUserParam getUser() {
		return user;
	}

	public void setUser(BbsUserParam user) {
		this.user = user;
	}
	
}
